﻿using Common.FrontEnd;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace FrontEnd
{
    /// <summary>
    ///  Indicates events like beginning or end of data, data dropped, quality changed, etc.. It implements the Data
    /// interface, and it will pass between DataProcessors to inform them about the Data that is passed between
    /// DataProcessors.
    ///
    /// @see Data
    /// @see DataProcessor
    /// </summary>
    public class Signal: IData
    {
        /** the time this Signal was issued. */
        private long time;

        /**
        /// A (lazily initialized) collection of names properties of this signal. This collection might contain infos about
        /// the file being processed, shift-size of frame-length of the windowing process, etc.
         */
        private Dictionary<String, Object> props;


        /**
        /// Constructs a Signal with the given name.
         *
        /// @param time the time this Signal is created
         */
        protected Signal(long time) 
        {
            this.time = time;
        }


        /**
        /// Returns the time this Signal was created.
         *
        /// @return the time this Signal was created
         */
        public long getTime() 
        {
            return time;
        }


        /** Returns the properties associated to this signal.
         */
        public Dictionary<String, Object> getProps() 
        {
            if (props == null)
                props = new Dictionary<String, Object>();

            return props;
        }

        void System.Runtime.Serialization.ISerializable.GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
        {
            throw new NotImplementedException();
        }
    }
}
